package com.csun.cmny.provider.controller.rpc;

import com.csun.cmny.provider.model.dto.sleep.BedOldmanSleepReqDto;
import com.csun.cmny.provider.model.vo.CsunSleepDataReqVo;
import com.csun.cmny.provider.service.DmcCsunSleepDataFeignApi;
import com.csun.cmny.provider.service.DmcCsunSleepDataService;
import com.csun.cmny.util.wrapper.WrapMapper;
import com.csun.cmny.util.wrapper.Wrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-03-14 21:09
 * @Description: the class dmc csun sleep data feign client
 */
@Slf4j
@RestController
public class DmcCsunSleepDataFeignClient implements DmcCsunSleepDataFeignApi {

    @Resource
    private DmcCsunSleepDataService dmcCsunSleepDataService;

    @Override
    public Wrapper<List<CsunSleepDataReqVo>> queryCsunSleepDataByBedOldmanList(@RequestBody List<BedOldmanSleepReqDto> bedOldmanSleepReqDtoList) {

        List<CsunSleepDataReqVo> csunSleepDataReqVoList = dmcCsunSleepDataService.queryCsunSleepDataByBedOldmanList(bedOldmanSleepReqDtoList);

        return WrapMapper.ok(csunSleepDataReqVoList);
    }

}
